3.126 \(\int \frac{(a+i a \tan (c+d x))^2 (A+B \tan (c+d x))}{\tan ^{\frac{9}{2}}(c+d x)} \, dx\)

Optimal. Leaf size=154 \[ -\frac{4 \sqrt [4]{-1} a^2 (A-i B) \tan ^{-1}\left ((-1)^{3/4} \sqrt{\tan (c+d x)}\right )}{d}+\frac{4 a^2 (A-i B)}{3 d \tan ^{\frac{3}{2}}(c+d x)}-\frac{2 a^2 (7 B+9 i A)}{35 d \tan ^{\frac{5}{2}}(c+d x)}+\frac{4 a^2 (B+i A)}{d \sqrt{\tan (c+d x)}}-\frac{2 A \left (a^2+i a^2 \tan (c+d x)\right )}{7 d \tan ^{\frac{7}{2}}(c+d x)} \]

[Out]

(-4*(-1)^(1/4)*a^2*(A - I*B)*ArcTan[(-1)^(3/4)*Sqrt[Tan[c + d*x]]])/d - (2*a^2*((9*I)*A + 7*B))/(35*d*Tan[c +
d*x]^(5/2)) + (4*a^2*(A - I*B))/(3*d*Tan[c + d*x]^(3/2)) + (4*a^2*(I*A + B))/(d*Sqrt[Tan[c + d*x]]) - (2*A*(a^
2 + I*a^2*Tan[c + d*x]))/(7*d*Tan[c + d*x]^(7/2))

________________________________________________________________________________________

Rubi [A]  time = 0.298643, antiderivative size = 154, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.139, Rules used = {3593, 3591, 3529, 3533, 205} \[ -\frac{4 \sqrt [4]{-1} a^2 (A-i B) \tan ^{-1}\left ((-1)^{3/4} \sqrt{\tan (c+d x)}\right )}{d}+\frac{4 a^2 (A-i B)}{3 d \tan ^{\frac{3}{2}}(c+d x)}-\frac{2 a^2 (7 B+9 i A)}{35 d \tan ^{\frac{5}{2}}(c+d x)}+\frac{4 a^2 (B+i A)}{d \sqrt{\tan (c+d x)}}-\frac{2 A \left (a^2+i a^2 \tan (c+d x)\right )}{7 d \tan ^{\frac{7}{2}}(c+d x)} \]

Antiderivative was successfully verified.

[In]

Int[((a + I*a*Tan[c + d*x])^2*(A + B*Tan[c + d*x]))/Tan[c + d*x]^(9/2),x]

[Out]

(-4*(-1)^(1/4)*a^2*(A - I*B)*ArcTan[(-1)^(3/4)*Sqrt[Tan[c + d*x]]])/d - (2*a^2*((9*I)*A + 7*B))/(35*d*Tan[c +
d*x]^(5/2)) + (4*a^2*(A - I*B))/(3*d*Tan[c + d*x]^(3/2)) + (4*a^2*(I*A + B))/(d*Sqrt[Tan[c + d*x]]) - (2*A*(a^
2 + I*a^2*Tan[c + d*x]))/(7*d*Tan[c + d*x]^(7/2))

Rule 3593

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> -Simp[(a^2*(B*c - A*d)*(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan[e + f*x])^
(n + 1))/(d*f*(b*c + a*d)*(n + 1)), x] - Dist[a/(d*(b*c + a*d)*(n + 1)), Int[(a + b*Tan[e + f*x])^(m - 1)*(c +
 d*Tan[e + f*x])^(n + 1)*Simp[A*b*d*(m - n - 2) - B*(b*c*(m - 1) + a*d*(n + 1)) + (a*A*d*(m + n) - B*(a*c*(m -
 1) + b*d*(n + 1)))*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ
[a^2 + b^2, 0] && GtQ[m, 1] && LtQ[n, -1]

Rule 3591

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e
_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((b*c - a*d)*(A*b - a*B)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2
 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e + f*x])^(m + 1)*Simp[a*A*c + b*B*c + A*b*d - a*B*d - (A*b*
c - a*B*c - a*A*d - b*B*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0]
 && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rule 3529

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e +
f*x])^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c
 - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1]

Rule 3533

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[(2*c^2)/f, S
ubst[Int[1/(b*c - d*x^2), x], x, Sqrt[b*Tan[e + f*x]]], x] /; FreeQ[{b, c, d, e, f}, x] && EqQ[c^2 + d^2, 0]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{(a+i a \tan (c+d x))^2 (A+B \tan (c+d x))}{\tan ^{\frac{9}{2}}(c+d x)} \, dx &=-\frac{2 A \left (a^2+i a^2 \tan (c+d x)\right )}{7 d \tan ^{\frac{7}{2}}(c+d x)}+\frac{2}{7} \int \frac{(a+i a \tan (c+d x)) \left (\frac{1}{2} a (9 i A+7 B)-\frac{1}{2} a (5 A-7 i B) \tan (c+d x)\right )}{\tan ^{\frac{7}{2}}(c+d x)} \, dx\\ &=-\frac{2 a^2 (9 i A+7 B)}{35 d \tan ^{\frac{5}{2}}(c+d x)}-\frac{2 A \left (a^2+i a^2 \tan (c+d x)\right )}{7 d \tan ^{\frac{7}{2}}(c+d x)}+\frac{2}{7} \int \frac{-7 a^2 (A-i B)-7 a^2 (i A+B) \tan (c+d x)}{\tan ^{\frac{5}{2}}(c+d x)} \, dx\\ &=-\frac{2 a^2 (9 i A+7 B)}{35 d \tan ^{\frac{5}{2}}(c+d x)}+\frac{4 a^2 (A-i B)}{3 d \tan ^{\frac{3}{2}}(c+d x)}-\frac{2 A \left (a^2+i a^2 \tan (c+d x)\right )}{7 d \tan ^{\frac{7}{2}}(c+d x)}+\frac{2}{7} \int \frac{-7 a^2 (i A+B)+7 a^2 (A-i B) \tan (c+d x)}{\tan ^{\frac{3}{2}}(c+d x)} \, dx\\ &=-\frac{2 a^2 (9 i A+7 B)}{35 d \tan ^{\frac{5}{2}}(c+d x)}+\frac{4 a^2 (A-i B)}{3 d \tan ^{\frac{3}{2}}(c+d x)}+\frac{4 a^2 (i A+B)}{d \sqrt{\tan (c+d x)}}-\frac{2 A \left (a^2+i a^2 \tan (c+d x)\right )}{7 d \tan ^{\frac{7}{2}}(c+d x)}+\frac{2}{7} \int \frac{7 a^2 (A-i B)+7 a^2 (i A+B) \tan (c+d x)}{\sqrt{\tan (c+d x)}} \, dx\\ &=-\frac{2 a^2 (9 i A+7 B)}{35 d \tan ^{\frac{5}{2}}(c+d x)}+\frac{4 a^2 (A-i B)}{3 d \tan ^{\frac{3}{2}}(c+d x)}+\frac{4 a^2 (i A+B)}{d \sqrt{\tan (c+d x)}}-\frac{2 A \left (a^2+i a^2 \tan (c+d x)\right )}{7 d \tan ^{\frac{7}{2}}(c+d x)}+\frac{\left (28 a^4 (A-i B)^2\right ) \operatorname{Subst}\left (\int \frac{1}{7 a^2 (A-i B)-7 a^2 (i A+B) x^2} \, dx,x,\sqrt{\tan (c+d x)}\right )}{d}\\ &=-\frac{4 \sqrt [4]{-1} a^2 (A-i B) \tan ^{-1}\left ((-1)^{3/4} \sqrt{\tan (c+d x)}\right )}{d}-\frac{2 a^2 (9 i A+7 B)}{35 d \tan ^{\frac{5}{2}}(c+d x)}+\frac{4 a^2 (A-i B)}{3 d \tan ^{\frac{3}{2}}(c+d x)}+\frac{4 a^2 (i A+B)}{d \sqrt{\tan (c+d x)}}-\frac{2 A \left (a^2+i a^2 \tan (c+d x)\right )}{7 d \tan ^{\frac{7}{2}}(c+d x)}\\ \end{align*}

Mathematica [A]  time = 7.11641, size = 296, normalized size = 1.92 \[ \frac{\cos ^3(c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \left (\frac{4 e^{-2 i c} (A-i B) \sqrt{-\frac{i \left (-1+e^{2 i (c+d x)}\right )}{1+e^{2 i (c+d x)}}} \tanh ^{-1}\left (\sqrt{\frac{-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}\right )}{\sqrt{\frac{-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}}-\frac{(\cos (2 c)-i \sin (2 c)) \csc ^3(c+d x) ((-25 A+70 i B) \cos (c+d x)+(85 A-70 i B) \cos (3 (c+d x))+42 \sin (c+d x) ((11 B+12 i A) \cos (2 (c+d x))-8 i A-9 B))}{210 \sqrt{\tan (c+d x)}}\right )}{d (\cos (d x)+i \sin (d x))^2 (A \cos (c+d x)+B \sin (c+d x))} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + I*a*Tan[c + d*x])^2*(A + B*Tan[c + d*x]))/Tan[c + d*x]^(9/2),x]

[Out]

(Cos[c + d*x]^3*((4*(A - I*B)*Sqrt[((-I)*(-1 + E^((2*I)*(c + d*x))))/(1 + E^((2*I)*(c + d*x)))]*ArcTanh[Sqrt[(
-1 + E^((2*I)*(c + d*x)))/(1 + E^((2*I)*(c + d*x)))]])/(E^((2*I)*c)*Sqrt[(-1 + E^((2*I)*(c + d*x)))/(1 + E^((2
*I)*(c + d*x)))]) - (Csc[c + d*x]^3*(Cos[2*c] - I*Sin[2*c])*((-25*A + (70*I)*B)*Cos[c + d*x] + (85*A - (70*I)*
B)*Cos[3*(c + d*x)] + 42*((-8*I)*A - 9*B + ((12*I)*A + 11*B)*Cos[2*(c + d*x)])*Sin[c + d*x]))/(210*Sqrt[Tan[c
+ d*x]]))*(a + I*a*Tan[c + d*x])^2*(A + B*Tan[c + d*x]))/(d*(Cos[d*x] + I*Sin[d*x])^2*(A*Cos[c + d*x] + B*Sin[
c + d*x]))

________________________________________________________________________________________

Maple [B]  time = 0.017, size = 570, normalized size = 3.7 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c))/tan(d*x+c)^(9/2),x)

[Out]

-2/7/d*a^2*A/tan(d*x+c)^(7/2)+4/3*a^2*A/d/tan(d*x+c)^(3/2)+I/d*a^2*A*2^(1/2)*arctan(1+2^(1/2)*tan(d*x+c)^(1/2)
)-I/d*a^2*B*2^(1/2)*arctan(1+2^(1/2)*tan(d*x+c)^(1/2))+4/d*a^2/tan(d*x+c)^(1/2)*B+4*I/d*a^2/tan(d*x+c)^(1/2)*A
-2/5/d*a^2/tan(d*x+c)^(5/2)*B+1/2*I/d*a^2*A*ln((1-2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c))/(1+2^(1/2)*tan(d*x+c)^(
1/2)+tan(d*x+c)))*2^(1/2)-1/2*I/d*a^2*B*2^(1/2)*ln((1+2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c))/(1-2^(1/2)*tan(d*x+
c)^(1/2)+tan(d*x+c)))-4/3*I/d*a^2/tan(d*x+c)^(3/2)*B+1/d*a^2*A*2^(1/2)*arctan(1+2^(1/2)*tan(d*x+c)^(1/2))+1/d*
a^2*A*arctan(-1+2^(1/2)*tan(d*x+c)^(1/2))*2^(1/2)+1/2/d*a^2*A*2^(1/2)*ln((1+2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c
))/(1-2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c)))-4/5*I/d*a^2/tan(d*x+c)^(5/2)*A-I/d*a^2*B*arctan(-1+2^(1/2)*tan(d*x
+c)^(1/2))*2^(1/2)+I/d*a^2*A*arctan(-1+2^(1/2)*tan(d*x+c)^(1/2))*2^(1/2)+1/2/d*a^2*B*ln((1-2^(1/2)*tan(d*x+c)^
(1/2)+tan(d*x+c))/(1+2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c)))*2^(1/2)+1/d*a^2*B*2^(1/2)*arctan(1+2^(1/2)*tan(d*x+
c)^(1/2))+1/d*a^2*B*arctan(-1+2^(1/2)*tan(d*x+c)^(1/2))*2^(1/2)

________________________________________________________________________________________

Maxima [A]  time = 2.01341, size = 289, normalized size = 1.88 \begin{align*} -\frac{105 \,{\left (2 \, \sqrt{2}{\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (\sqrt{2} + 2 \, \sqrt{\tan \left (d x + c\right )}\right )}\right ) + 2 \, \sqrt{2}{\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \arctan \left (-\frac{1}{2} \, \sqrt{2}{\left (\sqrt{2} - 2 \, \sqrt{\tan \left (d x + c\right )}\right )}\right ) + \sqrt{2}{\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \log \left (\sqrt{2} \sqrt{\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right ) - \sqrt{2}{\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \log \left (-\sqrt{2} \sqrt{\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right )\right )} a^{2} - \frac{4 \,{\left (210 \,{\left (i \, A + B\right )} a^{2} \tan \left (d x + c\right )^{3} +{\left (70 \, A - 70 i \, B\right )} a^{2} \tan \left (d x + c\right )^{2} + 21 \,{\left (-2 i \, A - B\right )} a^{2} \tan \left (d x + c\right ) - 15 \, A a^{2}\right )}}{\tan \left (d x + c\right )^{\frac{7}{2}}}}{210 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c))/tan(d*x+c)^(9/2),x, algorithm="maxima")

[Out]

-1/210*(105*(2*sqrt(2)*(-(I + 1)*A + (I - 1)*B)*arctan(1/2*sqrt(2)*(sqrt(2) + 2*sqrt(tan(d*x + c)))) + 2*sqrt(
2)*(-(I + 1)*A + (I - 1)*B)*arctan(-1/2*sqrt(2)*(sqrt(2) - 2*sqrt(tan(d*x + c)))) + sqrt(2)*((I - 1)*A + (I +
1)*B)*log(sqrt(2)*sqrt(tan(d*x + c)) + tan(d*x + c) + 1) - sqrt(2)*((I - 1)*A + (I + 1)*B)*log(-sqrt(2)*sqrt(t
an(d*x + c)) + tan(d*x + c) + 1))*a^2 - 4*(210*(I*A + B)*a^2*tan(d*x + c)^3 + (70*A - 70*I*B)*a^2*tan(d*x + c)
^2 + 21*(-2*I*A - B)*a^2*tan(d*x + c) - 15*A*a^2)/tan(d*x + c)^(7/2))/d

________________________________________________________________________________________

Fricas [B]  time = 2.29091, size = 1547, normalized size = 10.05 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c))/tan(d*x+c)^(9/2),x, algorithm="fricas")

[Out]

1/420*(105*sqrt((-16*I*A^2 - 32*A*B + 16*I*B^2)*a^4/d^2)*(d*e^(8*I*d*x + 8*I*c) - 4*d*e^(6*I*d*x + 6*I*c) + 6*
d*e^(4*I*d*x + 4*I*c) - 4*d*e^(2*I*d*x + 2*I*c) + d)*log((4*(A - I*B)*a^2*e^(2*I*d*x + 2*I*c) + sqrt((-16*I*A^
2 - 32*A*B + 16*I*B^2)*a^4/d^2)*(I*d*e^(2*I*d*x + 2*I*c) + I*d)*sqrt((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x
+ 2*I*c) + 1)))*e^(-2*I*d*x - 2*I*c)/((2*I*A + 2*B)*a^2)) - 105*sqrt((-16*I*A^2 - 32*A*B + 16*I*B^2)*a^4/d^2)*
(d*e^(8*I*d*x + 8*I*c) - 4*d*e^(6*I*d*x + 6*I*c) + 6*d*e^(4*I*d*x + 4*I*c) - 4*d*e^(2*I*d*x + 2*I*c) + d)*log(
(4*(A - I*B)*a^2*e^(2*I*d*x + 2*I*c) + sqrt((-16*I*A^2 - 32*A*B + 16*I*B^2)*a^4/d^2)*(-I*d*e^(2*I*d*x + 2*I*c)
 - I*d)*sqrt((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) + 1)))*e^(-2*I*d*x - 2*I*c)/((2*I*A + 2*B)*a^2)
) - 8*((337*A - 301*I*B)*a^2*e^(8*I*d*x + 8*I*c) - 6*(46*A - 63*I*B)*a^2*e^(6*I*d*x + 6*I*c) - 10*(5*A - 14*I*
B)*a^2*e^(4*I*d*x + 4*I*c) + 18*(22*A - 21*I*B)*a^2*e^(2*I*d*x + 2*I*c) - (167*A - 161*I*B)*a^2)*sqrt((-I*e^(2
*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) + 1)))/(d*e^(8*I*d*x + 8*I*c) - 4*d*e^(6*I*d*x + 6*I*c) + 6*d*e^(4*I
*d*x + 4*I*c) - 4*d*e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))**2*(A+B*tan(d*x+c))/tan(d*x+c)**(9/2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.27336, size = 184, normalized size = 1.19 \begin{align*} \frac{\left (2 i - 2\right ) \, \sqrt{2}{\left (-i \, A a^{2} - B a^{2}\right )} \arctan \left (-\left (\frac{1}{2} i - \frac{1}{2}\right ) \, \sqrt{2} \sqrt{\tan \left (d x + c\right )}\right )}{d} - \frac{-420 i \, A a^{2} \tan \left (d x + c\right )^{3} - 420 \, B a^{2} \tan \left (d x + c\right )^{3} - 140 \, A a^{2} \tan \left (d x + c\right )^{2} + 140 i \, B a^{2} \tan \left (d x + c\right )^{2} + 84 i \, A a^{2} \tan \left (d x + c\right ) + 42 \, B a^{2} \tan \left (d x + c\right ) + 30 \, A a^{2}}{105 \, d \tan \left (d x + c\right )^{\frac{7}{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c))/tan(d*x+c)^(9/2),x, algorithm="giac")

[Out]

(2*I - 2)*sqrt(2)*(-I*A*a^2 - B*a^2)*arctan(-(1/2*I - 1/2)*sqrt(2)*sqrt(tan(d*x + c)))/d - 1/105*(-420*I*A*a^2
*tan(d*x + c)^3 - 420*B*a^2*tan(d*x + c)^3 - 140*A*a^2*tan(d*x + c)^2 + 140*I*B*a^2*tan(d*x + c)^2 + 84*I*A*a^
2*tan(d*x + c) + 42*B*a^2*tan(d*x + c) + 30*A*a^2)/(d*tan(d*x + c)^(7/2))